package com.m3839.sdk.common.env2.platform;

import android.util.Pair;

import com.m3839.sdk.common.env.EnvConfig;
import com.m3839.sdk.common.env2.Env;
import com.m3839.sdk.common.env2.IPlatformApi;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ChenBaoyang
 * @description: YuanChuangPlatformApi
 * @date 2021/11/5 17:50
 */
public class YuanChuangPlatformApi extends IPlatformApi {

    /** 原创平台-快爆业务sdk-正式接口地址 */
    protected static final String SDK_3839_HOST = "https://sdk.3839app.com/";

    /** 原创平台-快爆业务sdk-测试接口地址 */
    protected static final String SDK_3839_HOST_TEST = "http://t.sdk.3839app.com/";

    /** ot环境header头字段 */
    protected static final String KEY_DEPLOYMENT = "deployment";
    protected static final String VALUE_OT = "online-test";

    public static Map<Integer, EnvConfig> envConfigMap = new HashMap<>();

    static {
        envConfigMap.put(Env.ENV_TEST, new EnvConfig(SDK_3839_HOST_TEST, null, null));
        envConfigMap.put(Env.ENV_ONLINE_TEST, new EnvConfig(SDK_3839_HOST, new Pair<>(KEY_DEPLOYMENT, VALUE_OT), null));
        envConfigMap.put(Env.ENV_OFFICIAL, new EnvConfig(SDK_3839_HOST, null, null));
    }

    @Override
    public EnvConfig getApi(int env) {
        return envConfigMap.get(env);
    }
}
